package net.yla.smartbus.core.constants;

import com.alibaba.fastjson.annotation.JSONType;
import jodd.util.StringUtil;

/**
 * @author wade
 * @date 2019/7/31
 */
@JSONType(serializeEnumAsJavaBean = true)
public enum IsShieldEnum {
    TRUE("true","屏蔽"),
    FALSE("false","不屏蔽");

    private String code;
    private String desc;

    IsShieldEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsShieldEnum getByCode(String code){
        if(StringUtil.isBlank(code)){
            return null;
        }
        for(IsShieldEnum isShieldEnum : values()){
            if(code.equals(isShieldEnum.getCode())){
                return isShieldEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}

